<?php

/**
 * ContactStaff form base class.
 *
 * @method ContactStaff getObject() Returns the current form's model object
 *
 * @package    ecollegeplus
 * @subpackage form
 * @author     Batanayi Matuku
 * @version    SVN: $Id: sfDoctrineFormGeneratedInheritanceTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseContactStaffForm extends ContactForm
{
  protected function setupInheritance()
  {
    parent::setupInheritance();

    $this->widgetSchema   ['staff_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Staff'), 'add_empty' => false));
    $this->validatorSchema['staff_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Staff')));

    $this->widgetSchema   ['postal_address_line_1'] = new sfWidgetFormTextarea();
    $this->validatorSchema['postal_address_line_1'] = new sfValidatorString(array('max_length' => 300));

    $this->widgetSchema   ['postal_address_line_2'] = new sfWidgetFormTextarea();
    $this->validatorSchema['postal_address_line_2'] = new sfValidatorString(array('max_length' => 300, 'required' => false));

    $this->widgetSchema   ['postal_postcode'] = new sfWidgetFormInputText();
    $this->validatorSchema['postal_postcode'] = new sfValidatorString(array('max_length' => 10, 'required' => false));

    $this->widgetSchema   ['postal_city'] = new sfWidgetFormInputText();
    $this->validatorSchema['postal_city'] = new sfValidatorString(array('max_length' => 255, 'required' => false));

    $this->widgetSchema   ['postal_country_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('PostalCountry'), 'add_empty' => false));
    $this->validatorSchema['postal_country_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('PostalCountry')));

    $this->widgetSchema   ['postal_state_province_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('PostalStateProvince'), 'add_empty' => false));
    $this->validatorSchema['postal_state_province_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('PostalStateProvince')));

    $this->widgetSchema->setNameFormat('contact_staff[%s]');
  }

  public function getModelName()
  {
    return 'ContactStaff';
  }

}
